//1/*方式1 标准for循环*/
var l = [2,32,3,1,344,3,5];
var sum=0;
for (var i=0;i<=l.length-1;i++){
	sum+=l[i];
}
console.log(sum);

//1/*方式2 while循环*/
var l = [2,32,3,1,344,3,5];
var sum=0;
var i=0;
while (i<=l.length-1){
	sum+=l[i];
	i+=1;
}
console.log(sum);

//1/*方式3  do while循环*/
var l = [2,32,3,1,344,3,5];
var sum=0;
var i=0;
do
{
	sum+=l[i];
	i+=1;
}while(i<=l.length-1)
console.log(sum);

//1/*方式4  for in 遍历对象/字典属性 */

var l = [2,32,3,1,344,3,5];
var sum=0;
var i=0;
for ( var i in l)
{
	sum+=l[i]
}
console.log(sum);

//1/*方式5 for of 遍历数组内容 */
var l = [2,32,3,1,344,3,5];
var sum=0;

for (var i of l)
{
	sum+=i;
}
console.log(sum);
//1/*方式6 forEach函数*/
var l = [2,32,3,1,344,3,5];
var sum=0;
l.forEach(function(i){
	sum+=i;
})
console.log(sum);

//1/*方式7 map函数*/
var l = [2,32,3,1,344,3,5];
var sum=0;
l.map(function(i){
	sum+=i;
})
console.log(sum);
//1/*方式8 Object - keys() values() entries()*/
